player1_x = 400 player1_y = 500 paddle_width = 100 paddle_height = 15 ball_speed_x = 50 ball_speed_y = -100 ball_x = 400 ball_y = 300 function love.draw() -- Draw Player 1 Paddle love.graphics.setColor(255,255,255) love.graphics.rectangle("fill", player1_x, player1_y, paddle_width, paddle_height) -- Add Player 2 Paddle Below -- Draw the ball love.graphics.setColor(255,255,255) love.graphics.circle("fill", ball_x, ball_y, 15, 15) end function love.keypressed(key, unicode) -- player 1 movement if key == 'a' then player1_x = player1_x - 10 end if key == 'd' then player1_x = player1_x + 10 end -- exit the game if key == 'escape' or key == 'q' then love.event.quit() end end function love.update(dt) -- ball location update ball_x = ball_x + ball_speed_x * dt ball_y = ball_y + ball_speed_y * dt -- collision detection if ball_y - 15 <= 0 and ball_speed_y < 0 then -- ceiling ball_speed_y = -1 * ball_speed_y elseif ball_y + 15 >= 600 and ball_speed_y > 0 then -- floor love.event.quit() elseif ball_x - 15 <= 0 and ball_speed_x < 0 then -- left wall ball_speed_x = -1 * ball_speed_x elseif ball_x + 15 >= 800 and ball_speed_x > 0 then -- right wall ball_speed_x = -1 * ball_speed_x end -- Can we change it to hit the paddle as well? Add that code here. end